package com.ay277.htqoa.quartz.entity;

import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.impl.JobDetailImpl;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.impl.triggers.CronTriggerImpl;

/**
 * Created by Temptation on 2016/12/22.
 */
public class Test2 {
    public static void main(String[] args) throws Exception {

        JobDetailImpl jd=new JobDetailImpl();
        jd.setName("myjob3");
        jd.setJobClass(MyJob3.class);

        CronTriggerImpl ct=new CronTriggerImpl();
        ct.setName("myjob3");
        ct.setCronExpression("0,10,20,30,40,50 * * * * ?");

        SchedulerFactory sd=new StdSchedulerFactory();
        Scheduler s=sd.getScheduler();
        s.scheduleJob(jd,ct);
        s.start();
        System.in.read();
        s.shutdown();
    }
}
